﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ManageComponentPrice.aspx.cs" Inherits="WXYW.ManageComponentPrice" %>

<%@ Register Namespace="WXYW.Controls" TagPrefix="WXYWControl" Assembly="WXYW.Common" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="Ajax" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
    元器件价格管理
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ButtonPlaceHolder" runat="server">
    关键字<asp:TextBox ID="keyWordTextBox" runat="server" Height="16px" onkeypress="enterTxtBox('searchLinkButton')"></asp:TextBox><asp:LinkButton
        ID="searchLinkButton" runat="server" OnClick="searchLinkButton_Click">查询</asp:LinkButton><asp:LinkButton
            ID="resetLinkButton" runat="server" OnClick="resetLinkButton_Click">清除</asp:LinkButton>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="RightContentPlaceHolder" runat="server">
    <WXYWControl:CustomGridView ID="AccessoryListGridView" runat="server" CssClass="tableList"
        Width="100%" AutoGenerateColumns="False" AllowPaging="true" AllowSorting="true"
        PageSize="20" OnRowCommand="AccessoryListGridView_RowCommand" OnRowDataBound="AccessoryListGridView_RowDataBound"
        OnDataBound="AccessoryListGridView_DataBound" OnPageIndexChanging="AccessoryListGridView_PageIndexChanging"
        OnSorting="AccessoryListGridView_Sorting" OnMustAddARow="AccessoryListGridView_MustAddARow">
        <Columns>
            <asp:TemplateField HeaderImageUrl="~/image/operateicon/button_Select.gif">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="IDLbl" runat="server"></asp:Label>
                </ItemTemplate>
                <ItemStyle Width="3%" />
            </asp:TemplateField>
            <asp:BoundField HeaderText="物料号" DataField="MaterialNO" SortExpression="MaterialNO">
                <HeaderStyle Wrap="False" />
                <ItemStyle HorizontalAlign="Left" Wrap="False" Width="5%" />
            </asp:BoundField>
            <asp:BoundField HeaderText="原料型号" DataField="ModelNO" SortExpression="ModelNO">
                <HeaderStyle Wrap="False" />
                <ItemStyle HorizontalAlign="Left" Wrap="False" Width="7%" />
            </asp:BoundField>
            <asp:BoundField HeaderText="原料数量" DataField="Count" SortExpression="Count">
                <HeaderStyle Wrap="False" />
                <ItemStyle HorizontalAlign="Left" Wrap="False" Width="5%" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="原料描述" SortExpression="Description">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Description") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:TextBox ID="TextBox3" runat="server" CssClass="NOBorderTxtBox" TextMode="MultiLine"
                        Rows="1" Text='<%# Bind("Description") %>' ReadOnly="true" Width="200px"></asp:TextBox>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Left" Width="15%" Wrap="False" />
            </asp:TemplateField>
            <asp:BoundField HeaderText="原料分类" DataField="Class" SortExpression="Class">
                <HeaderStyle Wrap="False" />
                <ItemStyle Wrap="False" Width="10%" />
            </asp:BoundField>
            <asp:BoundField HeaderText="成本价格" DataField="CHPrice" SortExpression="CHPrice">
                <HeaderStyle Wrap="False" />
                <ItemStyle HorizontalAlign="Left" Wrap="False" Width="10%" />
            </asp:BoundField>
            <asp:BoundField HeaderText="收费价格" DataField="Price" SortExpression="Price">
                <HeaderStyle Wrap="False" />
                <ItemStyle HorizontalAlign="Left" Wrap="False" Width="10%" />
            </asp:BoundField>
            <asp:BoundField DataField="Station" HeaderText="储存地" SortExpression="Station">
                <HeaderStyle Wrap="False" />
                <ItemStyle HorizontalAlign="Left" Wrap="False" Width="10%" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="价格更新" ShowHeader="False">
                <ItemTemplate>
                    <img src="image/operateicon/docedit.gif" alt="" />
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" CommandName="ChangePrice"
                        Text="修改" CommandArgument='<%#Eval("ID") %>'></asp:LinkButton>
                </ItemTemplate>
                <HeaderStyle Wrap="False" />
                <ItemStyle Width="10%" Wrap="False" />
            </asp:TemplateField>
        </Columns>
        <PagerTemplate>
            本类记录<span style="color: Red"><%= AccessoryListGridView.Rows.Count%></span>条, <span
                style="color: Red">20</span>条/页 当前 <span style="color: Red">
                    <%= AccessoryListGridView.PageIndex + 1%>/<%= AccessoryListGridView.PageCount%></span>页
            <asp:LinkButton CommandName="Page" CommandArgument="First" ID="LinkButton1" runat="server"
                Style="color: blue">首页</asp:LinkButton><asp:LinkButton CommandName="Page" CommandArgument="Prev"
                    ID="LinkButton2" runat="server" Style="color: blue">|上一页</asp:LinkButton>
            <asp:LinkButton CommandName="Page" CommandArgument="Next" ID="LinkButton3" runat="server"
                Style="color: blue">下一页</asp:LinkButton><asp:LinkButton CommandName="Page" CommandArgument="Last"
                    ID="LinkButton4" runat="server" Style="color: blue">|尾页</asp:LinkButton>
            转到<asp:DropDownList ID="pageDDL" runat="server" AutoPostBack="True" OnSelectedIndexChanged="pageDDL_SelectedIndexChanged">
            </asp:DropDownList>
        </PagerTemplate>
        <HeaderStyle ForeColor="White" Font-Bold="True" BackColor="#A55129"></HeaderStyle>
    </WXYWControl:CustomGridView>
    <asp:HiddenField ID="CurrentComponetID" runat="server" />
    <asp:HiddenField ID="OriginalModelNO" runat="server" />
    <Ajax:ModalPopupExtender ID="AccessoryPricePopupExtender" TargetControlID="CurrentComponetID"
        PopupControlID="UpdateAccessoryPricePanel" BackgroundCssClass="modalBackground"
        runat="server" Drag="true" PopupDragHandleControlID="TransferDragBar" CancelControlID="CloseLnkBtn">
    </Ajax:ModalPopupExtender>
    <asp:Panel ID="UpdateAccessoryPricePanel" CssClass="modalPopup" Width="450px" runat="server"
        DefaultButton="SavePriceLnkBtn">
        <!-- Header -->
        <div class="box-header" id="TransferDragBar">
            <img src="image/stdBox_left_top.gif" alt="" />
            <h2>
                元器件价格更新</h2>
        </div>
        <div class="functionPanel">
            <table width="100%" style="line-height: 30px">
                <tr style="text-align: right">
                    <td colspan="5">
                        <img src="image/operateicon/check.gif" alt="" />
                        <asp:LinkButton ID="SavePriceLnkBtn" runat="server" Text="保存" OnClick="SavePriceLnkBtn_Click"
                            ValidationGroup="AccessoryValidation"></asp:LinkButton>
                        <img src="image/cancel.gif" alt="" />
                        <asp:LinkButton ID="CloseLnkBtn" runat="server" Text="关闭"></asp:LinkButton>
                    </td>
                </tr>
                <tr>
                    <td style="width: 20%">
                        原料型号:
                    </td>
                    <td style="width: 30%">
                        <asp:TextBox ID="ComponentModelNOTxtBox" runat="server" Width="80%"></asp:TextBox>
                    </td>
                    <td style="width: 2%">
                    </td>
                    <td>
                    </td>
                    <td>
                    </td>
                </tr>
                <tr>
                    <td>
                        成本价格:
                    </td>
                    <td>
                        <asp:TextBox ID="CHPriceTxtBox" runat="server" Width="80%"></asp:TextBox>
                    </td>
                    <td style="color: Red">
                        *
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="PriceRequiredFieldValidator" runat="server" ErrorMessage=""
                            Display="Dynamic" Text="请输入合法的价格" ControlToValidate="CHPriceTxtBox" ValidationGroup="AccessoryValidation"></asp:RequiredFieldValidator>
                    </td>
                    <td>
                        <asp:RegularExpressionValidator ID="PriceValidator" runat="server" ErrorMessage=""
                            Text="请输入合法的价格" ValidationExpression="^\-?[0-9]*\.?[0-9]*$" ControlToValidate="CHPriceTxtBox"
                            ValidationGroup="AccessoryValidation"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        收费价格:
                    </td>
                    <td>
                        <asp:TextBox ID="SFPriceTxtBox" runat="server" Width="80%"></asp:TextBox>
                    </td>
                    <td style="color: Red">
                        *
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage=""
                            Display="Dynamic" Text="请输入合法的价格" ControlToValidate="SFPriceTxtBox" ValidationGroup="AccessoryValidation"></asp:RequiredFieldValidator>
                    </td>
                    <td>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage=""
                            Text="请输入合法的价格" ValidationExpression="^\-?[0-9]*\.?[0-9]*$" ControlToValidate="SFPriceTxtBox"
                            ValidationGroup="AccessoryValidation"></asp:RegularExpressionValidator>
                    </td>
                </tr>
            </table>
        </div>
        <div class="box-footer">
            <img alt="" src="image/stdBox_left_bottom.gif" />
            <p>
                &nbsp;</p>
        </div>
    </asp:Panel>
</asp:Content>
